const user = require("./delete_user")
const article = require("./delete_article")
const comment = require("./delete_comment")
exports.create =(router)=> {
    const api = {
        user,
        article,
        comment
    }
    router.post("/delete", async (req, res) => {
        try {
           const response = await api[req.body.type].create(req.body.data);
           res.send(response)
        } catch (error) {
            console.error(error);
            res.status(500).send({ message: false });
        }
    });
    
}